﻿#region Copyrights Notice
//©2009 Microsoft Corporation.  All rights reserved.
#endregion

using System;
using System.DirectoryServices;
using System.Globalization;
using Microsoft.CISG.BitlockerRecovery.BL;

namespace BitlockerRecovery
{
    public partial class AdminMain : System.Web.UI.MasterPage
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
        protected void Page_Load(object sender, EventArgs e)
        {
            int AdminRoleID = Int32.Parse(System.Configuration.ConfigurationSettings.AppSettings["AppAdminRoleID"],CultureInfo.CurrentCulture);
            int UserRoleID = CommonBL.ActiveDirectoryPropertyGroupLookup(AdminRoleID);

            if (UserRoleID != AdminRoleID)
            {
                Response.Redirect("~\\Default.aspx");
            }
            Retrieval.Text = "<a class='NavLink' href='" + ResolveClientUrl("~/Admin/Default.aspx") + "'>Retrieval</a>";
            Reports.Text = "<a class='NavLink' href='" + ResolveClientUrl("~/Admin/Reports.aspx") + "'>Reports</a>";
            Configure.Text = "<a class='NavLink' href='" + ResolveClientUrl("~/Admin/Configure.aspx") + "'>Configure</a>";
            Faq.Text = "<a class='NavLink' href='" + ResolveClientUrl("~/Faq.aspx") + "'>Help</a>";
        }
    }
}
